package com.cyj.dream.admin.model.vo;

import io.swagger.annotations.ApiModel;
import lombok.Data;

import java.awt.image.BufferedImage;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @Description: 图片验证码返回
 * @BelongsProject: dream-DreamChardonnay
 * @BelongsPackage: com.dream.DreamChardonnay.model.vo
 * @Author: ChenYongJia
 * @CreateTime: 2021-06-08 09:51
 * @Email: chen87647213@163.com
 * @Version: 1.0
 */
@Data
@ApiModel(value = "图片验证码返回", description = "ImageCode 图片验证码返回")
public class ImageCode implements Serializable {

	private String code;

	private LocalDateTime expireTime;

	private BufferedImage image;

	public ImageCode(BufferedImage image, String sRand, int defaultImageExpire) {
		this.image = image;
		this.code = sRand;
		this.expireTime = LocalDateTime.now().plusSeconds(defaultImageExpire);
	}

}
